import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:go_router/go_router.dart';

class WalletScreen extends StatelessWidget {
  const WalletScreen({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        leading: IconButton(
          icon: const Icon(Icons.arrow_back),
          onPressed: () => context.pop(),
        ),
        title: const Text('零钱'),
        actions: [
          TextButton(
            onPressed: () {
              context.push('/wallet/transactions');
            },
            child: const Text('零钱明细'),
          ),
        ],
      ),
      body: SafeArea(
        child: Column(
          children: [
            // 余额显示区域
            Expanded(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  // 圆形图标
                  Container(
                    width: 60.w,
                    height: 60.w,
                    decoration: const BoxDecoration(
                      color: Color(0xFFFFBE00),
                      shape: BoxShape.circle,
                    ),
                    child: Icon(
                      Icons.currency_yen,
                      color: Colors.white,
                      size: 30.r,
                    ),
                  ),
                  SizedBox(height: 20.h),
                  const Text('我的余额'),
                  SizedBox(height: 10.h),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text(
                        '0.23',
                        style: TextStyle(
                          fontSize: 40.sp,
                          fontWeight: FontWeight.w500,
                        ),
                      ),
                    ],
                  ),
                  SizedBox(height: 20.h),
                  Text(
                    '转入零钱通，能赚又能花 >',
                    style: TextStyle(
                      fontSize: 14.sp,
                      color: const Color(0xFFFFBE00),
                    ),
                  ),
                ],
              ),
            ),
            // 底部按钮区域
            Padding(
              padding: EdgeInsets.only(
                left: 16.w,
                right: 16.w,
                bottom: MediaQuery.of(context).padding.bottom + 8.h,
                top: 8.h,
              ),
              child: Column(
                mainAxisSize: MainAxisSize.min,
                children: [
                  // 充值按钮
                  SizedBox(
                    width: double.infinity,
                    child: ElevatedButton(
                      onPressed: () {
                        context.push('/wallet/recharge');
                      },
                      style: ElevatedButton.styleFrom(
                        backgroundColor: const Color(0xFF07C160),
                        padding: EdgeInsets.symmetric(vertical: 12.h),
                        shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(4),
                        ),
                      ),
                      child: Text(
                        '充值',
                        style: TextStyle(
                          fontSize: 16.sp,
                          color: Colors.white,
                        ),
                      ),
                    ),
                  ),
                  SizedBox(height: 12.h),
                  // 提现按钮
                  SizedBox(
                    width: double.infinity,
                    child: ElevatedButton(
                      onPressed: () {},
                      style: ElevatedButton.styleFrom(
                        backgroundColor: Colors.white,
                        padding: EdgeInsets.symmetric(vertical: 12.h),
                        shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.circular(4),
                          side: const BorderSide(color: Colors.black12),
                        ),
                      ),
                      child: Text(
                        '提现',
                        style: TextStyle(
                          fontSize: 16.sp,
                          color: Colors.black87,
                        ),
                      ),
                    ),
                  ),
                  SizedBox(height: 16.h),
                  // 底部说明文字
                  const Text(
                    '本服务由财付通提供',
                    style: TextStyle(
                      color: Colors.black38,
                    ),
                  ),
                  SizedBox(height: 8.h),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
